// 单例模式实现配置管理类
public class ConfigManager {
    private static ConfigManager instance;

    private ConfigManager() {
        // 私有构造函数，防止外部直接实例化
    }

    public static synchronized ConfigManager getInstance() {
        if (instance == null) {
            instance = new ConfigManager();
        }
        return instance;
    }

    public void showConfigInfo() {
        System.out.println("显示配置信息");
    }
}

// 测试单例模式
public class SingletonTest {
    public static void main(String[] args) {
        ConfigManager config1 = ConfigManager.getInstance();
        ConfigManager config2 = ConfigManager.getInstance();
        System.out.println(config1 == config2);  // 输出为true，表明是同一个实例

        config1.showConfigInfo();
    }
}